import { ApiProperty } from "@nestjs/swagger";
import { IsNotEmpty } from "class-validator";
import { Classify } from "src/modules/classify/classify.entity";
import { Tag } from "src/modules/tag/tag.entity";

export class CreateArticleDto {
    @ApiProperty({
        description:'标题'
    })
    @IsNotEmpty({
        message:'标题不能为空'
    })
    title: string;
    
    @ApiProperty({
        description:'描述',
        required:false
    })
    desc: string;

    @ApiProperty({
        description:'封面',
        required:false
    })
    cover: string;

    @ApiProperty({
        description:'内容'
    })
    @IsNotEmpty({
        message:'内容不能为空'
    })
    content: string;

    @ApiProperty({
        description:'排序'
    })
    @IsNotEmpty({
        message:'排序不能为空'
    })
    sort: number;

    @ApiProperty({
        description:'状态'
    })
    @IsNotEmpty({
        message:'状态不能为空'
    })
    status: number;

    @ApiProperty({
        description:'分类'
    })
    @IsNotEmpty({
        message:'分类不能为空'
    })
    classify: number|Classify;

    @ApiProperty({
        description:'标签集'
    })
    @IsNotEmpty({
        message:'标签集不能为空'
    })
    tags:Array<number>|Array<Tag>;
}
